UserViewModel

abstract class UserViewModel<T> : BaseViewModel, OnPagedDataLoader<T>

ViewModel preparing and managing data related with the list of users since 3.0.0

Constructors

Link copied to clipboard
open fun UserViewModel(@NonNull channelUrl: String)
Constructor
Link copied to clipboard
open fun UserViewModel(@NonNull channelUrl: String, @Nullable queryHandler: PagedQueryHandler<T>)
Constructor

Functions

Link copied to clipboard
open fun addOperator(@NonNull userId: String, @Nullable handler: OnCompleteHandler)
Adds user with userId as operators.
Link copied to clipboard
open fun addOperators(@NonNull userIds: List<String>, @Nullable handler: OnCompleteHandler)
Adds users with id in userIds as operators.
Link copied to clipboard
open fun authenticate(@NonNull handler: AuthenticateHandler)
Tries to connect Sendbird Server and retrieve a channel instance.
Link copied to clipboard
open fun banUser(@NonNull userId: String, @Nullable handler: OnCompleteHandler)
Bans the user with userId.
Link copied to clipboard
protected abstract fun createQueryHandler(@NonNull channelUrl: String): PagedQueryHandler<T>
Create a query handler that is loading paged data.
Link copied to clipboard
open fun getChannelDeleted(): LiveData<Boolean>
Returns LiveData that can be observed if the channel has been deleted.
Link copied to clipboard
open fun getOperatorUnregistered(): LiveData<Boolean>
Returns LiveData that can be observed if the current user has been unregistered from the operator.
Link copied to clipboard
open fun getStatusFrame(): LiveData<StatusFrameView.Status>
Returns LiveData that can be observed for the status of the result of fetching the user list.
Link copied to clipboard
open fun getUserList(): LiveData<List<T>>
Returns LiveData that can be observed for the list of users.
Link copied to clipboard
open fun hasNext(): Boolean
Determine whether the data on the next page exists.
Link copied to clipboard
open fun hasPrevious(): Boolean
Returns false as the user list do not support to load for the previous by default.
Link copied to clipboard
open fun inviteUser(@NonNull userIds: List<String>, @Nullable handler: OnCompleteHandler)
Invites users with id in userIds to the channel.
Link copied to clipboard
open fun loadInitial(): Boolean
Requests the list of Users for the first time.
Link copied to clipboard
open fun loadNext(): List<T>
Requests the list of Users.
Link copied to clipboard
open fun loadPrevious(): List<T>
Returns the empty list as the user list do not support to load for the previous by default.
Link copied to clipboard
open fun muteUser(@NonNull userId: String, @Nullable handler: OnCompleteHandler)
Mutes the user with userId.
Link copied to clipboard
protected open fun onCleared()
Link copied to clipboard
open fun removeOperator(@NonNull userId: String, @Nullable handler: OnCompleteHandler)
Dismisses operator with userId.
Link copied to clipboard
open fun unbanUser(@NonNull userId: String, @Nullable handler: OnCompleteHandler)
Unbans the user with userId.
Link copied to clipboard
open fun unmuteUser(@NonNull userId: String, @Nullable handler: OnCompleteHandler)
Unmutes the user with userId.

Properties

Link copied to clipboard
open val channel: GroupChannel
Link copied to clipboard
val channelUrl: String

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard